{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}{% endblock %}</title>
    <link rel="stylesheet" href="{% static "css/base.css" %}">
</head>
<body>
    <div id="header">
        <span class="logo">论坛</span>
        {% if request.user.is_authenticated  %}
            <ul class="menu">
                <li>{% if section == "dashboard" %}class="selected"{% endif %}
                    <a href="{% url 'account:dashboard' %}">My dashboard</a>
                </li>
                <li>{% if section == "images" %}class="selected"{% endif %}
                    <a href="#">头像</a>
                </li>
                <li>{% if section == "people" %}class="selected"{% endif %}
                    <a href='{% url "account:user_list" %}'>人</a>
                </li>
            </ul>
        {% endif %}
        <span class="user">
            {% if request.user.is_authenticated  %}
                欢迎{{ request.user.username }}<a href="{% url 'account:logout' %}">退出</a>
            {% else %}
                <a href="{% url 'account:login' %}">登陆</a>
            {% endif %}
        </span>
    </div>

        {% if messages %}
            <ul class="messages">
                {% for message in messages %}
                    <li class="{{ message.tags }}">
                        {{ message|safe }}
                        <a href="#" class="close">x</a>
                    </li>
                {% endfor %}
            </ul>
        {% endif %}

    <div id="content">
        {% block content %}
        {% endblock %}
    </div>
</body>
</html>